using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Summary description for SearchController
/// </summary>
public class SearchController
{
    public static readonly int SearchType_Job = 1;
    public static readonly int SearchType_Exp = 2;
    public static readonly int SearchType_News = 3;
    public static readonly int SearchType_Org = 4;

    #region users
    public static readonly int SearchType_Company = 1001;
    public static readonly int SearchType_School = 1002;
    public static readonly int SearchType_Title = 1003;
        
    #endregion


    public static readonly string URL_SEARCH_USR = "SearchUsr.aspx?t={0}&q={1}";
        
    public SearchController()
    {
        //
        // TODO: Add constructor logic here
        //
    }


    public static string DoSearch(int type, object obj)
    {
        if (type <1000)
        {
            //dispatch to the index manager   

        }
        else
        {
            //dispatch to the linear search in database         
                if(type == SearchType_Company)
                {
                    return string.Format(URL_SEARCH_USR, "usr_company", obj);
                }
                else if(type == SearchType_School)
                {
                    return string.Format(URL_SEARCH_USR, "usr_sch", obj);
                }
                else if(type == SearchType_Title)
                {
                    return string.Format(URL_SEARCH_USR, "usr_title", obj);
                }                
         
                    
        }
        return string.Empty;
    }
}
